package chapter;

public class object_extends02 {
    public static void main(String[] args) {
        Person person_0 = new Person();
        person_0.testPerson();
        Person person_1 = new Boy();
        person_1.testPerson();
        //person_1.testBoy();
        //TODO 以父类构建的对象只能用父类的方法
        Person person_2 = new Girl();

    }
}
class Person {
    void testPerson() {
        System.out.println("Person");
    }
}
class Boy extends Person {
    void testBoy() {
        System.out.println("Boy");
    }
}
class Girl extends Person {
    void testGirl() {
        System.out.println("Girl");
    }
}